﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SiteRequireLogin.Master" AutoEventWireup="true" CodeBehind="ScanThuoc.aspx.cs" Inherits="TranTekBE.ScanThuoc.ScanThuoc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="scanthuoc.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <br />
    <br />
    <br />
    <br />
    <br />
    <div id="divscanthuoc">
        <asp:Panel runat="server" DefaultButton="ButtonOK">
            <table class="">
                <tbody>
                    <tr>
                        <td>Vị trí Scan<br/>
                             <span style="color: red;">(<%=PositionLogin %>)</span></td>
                        <td>
                            <asp:HiddenField ID="hfLanScanId" Value="" runat="server" />
                            <asp:HiddenField ID="hfScanThuocId" Value="" runat="server" />
                            <asp:Label ID="LabelVitri" CssClass="vitri" runat="server"></asp:Label>
                            <asp:Button ID="ButtonXong" runat="server" Text="Xong" OnClick="ButtonXong_Click" />
                            <div></div>
                        </td>
                    </tr>
                    <tr>
                        <td>Scan Mã Thuốc</td>
                        <td>
                            <asp:TextBox ID="TextBoxScan" runat="server" Width="306px"></asp:TextBox>
                            <asp:Button ID="ButtonOK" runat="server" Text="OK" OnClick="ButtonOK_Click" />
                            <div></div>
                            <asp:Label ID="LabelMessage" runat="server" Text="Thành công" ForeColor="green"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" EnableModelValidation="True" Width="100%">
                                <Columns>
                                    <asp:BoundField DataField="ProductId" HeaderText="Mã Thuốc" />
                                    <asp:BoundField DataField="ProductName" HeaderText="Tên Thuốc" />
                                    <asp:BoundField DataField="StoreName" HeaderText="Cửa Hàng" />
                                    <asp:TemplateField HeaderText="Vị Trí">
                                        <ItemTemplate>
                                            <asp:Label CssClass='<%# Eval("ViTri1").ToString()==LabelVitri.Text?"DungViTri":"SaiViTri" %>' ID="Label1" runat="server" Text='<%# Bind("ViTri1") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </td>
                    </tr>
                </tbody>
            </table>
        </asp:Panel>
        <table style="width: 100%;">
            <tr>
                <td>
                    Danh sách thuốc đã scan ở vị trí 
                    <asp:DropDownList ID="ddlVitri" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ddlVitri_SelectedIndexChanged"></asp:DropDownList>
                    <asp:Label ID="LabelCountScan" runat="server" Text=""></asp:Label>
                    <asp:Button ID="ButtonScanThem" runat="server" Text="Scan Thêm" OnClick="ButtonScanThem_Click" />
                </td>
            </tr>
            <tr>
                <td>
                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" EnableModelValidation="True" Width="100%" AllowPaging="True" OnPageIndexChanging="GridView2_PageIndexChanging">
                        <Columns>
                            <asp:BoundField DataField="ThuocId" HeaderText="Mã Thuốc" />
                            <asp:BoundField DataField="TenThuoc" HeaderText="Tên Thuốc" />
                            <asp:BoundField DataField="ViTriCu" HeaderText="Vị Trí Củ" />
                            <asp:BoundField DataField="ViTriMoi" HeaderText="Vị Trí Mới" />
                            <asp:BoundField DataField="CreatedDate" HeaderText="Lúc Scan" />
                        </Columns>
                    </asp:GridView>

                </td>
            </tr>
        </table>
    </div>
    <script>
        $(document).ready(function () {
            $("#ctl00_BodyContent_TextBoxScan").focus();
        });
    </script>
</asp:Content>
